<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<div class="span12 box-content">
	<form class="form-inline well" id="unchooseListFilter_form">
		<div class="controls controls-row">
			<label>学院:</label>
			<select class="span2" style="display:inline;" name="college" ${user.superAdmin?"":"disabled" }>
			  <c:forEach items="${colleges }" var="c">
			 	 <option value="${c.id }" ${c.id==classInfo.branch.prof.department.college.id?"selected='selected'":""}>${c.name }</option>
			  </c:forEach>
			</select>
			<label>系:</label>
			<select class="span2" style="display:inline;" name="department" data-org="${classInfo.branch.prof.department.id }">
			</select>
			<label>班级:</label>
			<select class="span2" style="display:inline;" name="classInfo" data-org="${classInfo.id }">
			</select>
			<button type="button" id="unchooseListFilter_go">筛选</button>
		</div>
	</form>
	<div class="span12">共有${studentCount}条数据,${totalPage }页</div>
	<table class="table table-striped table-bordered" id="student_list_table">
		<thead>
		 <tr role="row">
		 	<th >学号</th>
		 	<th>姓名</th>
		 	<th>班级</th>
		 	<th>更多</th>
		 </tr>
		</thead>   
		<tbody>
		<c:forEach items="${unchooseList }" var="s">
			<tr>
				<td>${s.no }</td>
				<td>${s.name }</td>
				<td>${s.classInfo.name }</td>
				<td class="center">
				<c:if test="${!user.superAdmin &&user.collegeId!=s.classInfo.branch.prof.department.college.id}">
					<c:set var="editDisabled" value="disabled"/>
				</c:if>
					<button type="button" class="btn btn-info chooseManual" data-studentId="${s.id }"  ${editDisabled }>
						<i class="icon-edit icon-white"></i>  
						手动选择题目
					</button>
					<c:if test="${editDisabled!=null }">
						无权操作
					</c:if>
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination  pagination-centered"
			data-totalPage="${totalPage }" 
			data-currentPage="${page }" 
			data-url="<%=basePath%>admin/choose/showUnchooseList/${classInfo.id }/{page}"
			style="display:none">
	</div>
	<div class="well">
		<a href="<%=basePath %>admin/choose/autoChoose" class="btn btn-primary" id="student_add"  >
			<i class="icon-tasks icon-white"></i>
			自动选题
		</a>
		<a href="<%=basePath %>admin/choose/unchooseList.xls" class="btn btn-success"  >
			<i class="  icon-download-alt icon-white"></i>  
			导出所有未选题学生列表(Excel2003格式)
		</a>		
		<a href="<%=basePath %>admin/choose/unchooseList.xlsx" class="btn btn-success" >
			<i class="  icon-download-alt icon-white"></i>  
			导出所有未选题学生列表(Excel2007格式)
		</a>
	</div>
</div>
<!-- 手动选题 开始-->
<div class="modal hide fade" id="choose_manual_box">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal">×</button>
		<h3>选择题目</h3>
	</div>
	<div class="modal-body">
		<input type="hidden" name="stuId"/>
		<div  class="ajax_wait" style="text-align: center;"><img src="<%=basePath %>images/ajax-loader.gif" title="wait" /></div>
        <div id="choose_manual_box_alert_container" ></div><br/>
        <div id="project_list_choose" style="display: none;height:50px;">
        	<select name="project_select" data-placeholder="请选择题目" data-rel="chosen" >
        	</select>
        	<p id="project_list_choose_detail" style="margin-top: 10px;">请选择题目</p>
        </div>
	</div>
	<div class="modal-footer">
		<a href="#" class="btn" data-dismiss="modal">取消</a>
		<a href="#" class="btn btn-primary" id="choose_manual_box_confirm">确认</a>
	</div>
</div>
<!-- 手动选题  结束 -->